home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10197 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: bert.compusmart.ab.ca!usenet
  2. From: cpettica@compusmart.ab.ca (Chris)
  3. Newsgroups: comp.lang.c++
  4. Subject: Need help with far pointers to struct in .h file
  5. Date: 3 Mar 1996 22:09:52 GMT
  6. Organization: Your Organization
  7. Message-ID: <4hd5bg$cvd@bert.compusmart.ab.ca>
  8. NNTP-Posting-Host: remote140.compusmart.ab.ca
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.6
  12.  
  13. When I try to run my program I get a general protection exception.  It dies 
  14. in this function, which of course is the first one called when I select 
  15. checkers.  I have marked the line, which is the first line executed.
  16.  
  17. Do I have to declare the array somewhere(WM_CREATE ??) in the cpp file?
  18.  
  19.  
  20. void fnInitCheckerArray(LPARAM lParam)
  21. {
  22.         GAMEDATA far * lPtr;
  23.     lPtr = (GAMEDATA far *)lParam;
  24.  
  25.     for (int iRow = 0; iRow < CHECKER_ROWS; iRow++)
  26.         for(int iColumn = 0; iColumn < CHECKER_COLUMNS; iColumn++)
  27.         {
  28.             if ((iRow + iColumn)%2)
  29.             {
  30.             if(iRow < 3)
  31.                 lPtr->aiCheckerArray[iRow][iColumn] = 1; 
  32.                         else if (iRow > 4)
  33.                 lPtr->aiCheckerArray[iRow][iColumn] = 2; 
  34.                 else
  35.                 lPtr->aiCheckerArray[iRow][iColumn] = 0; 
  36.             }
  37.             else
  38. ----------------->>>>>>        lPtr->aiCheckerArray[iRow][iColumn] = -1; 
  39.         }
  40.     return;
  41. }
  42.  
  43.  
  44. Thanks in advance
  45. Chris
  46.  
  47.